<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-resource-card-list selectable="false"
                       with-statuses="false">
  <kd-resource-card-list-header>
    <kd-resource-card-list-title>
      [[Conditions|Label 'Conditions' for the conditions section.]]
    </kd-resource-card-list-title>
  </kd-resource-card-list-header>
  <kd-resource-card-header-columns>
    <kd-resource-card-header-column size="small"
                                    grow="2">
      [[Type|Label 'Type' for the condition table header.]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="1">
      [[Status|Label 'Status' for the condition table header.]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="1">
      [[Last heartbeat time|Label 'Last heartbeat time' for the condition table header.]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="1">
      [[Last transition time|Label 'Last transition time' for the condition table header.]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="medium"
                                    grow="2">
      [[Reason|Label 'Reason' for the condition table header.]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="medium"
                                    grow="4">
      [[Message|Label 'Message' for the condition table header.]]
    </kd-resource-card-header-column>
  </kd-resource-card-header-columns>
  <kd-resource-card ng-repeat="condition in $ctrl.conditions"
                    omit-meta="true">
    <kd-resource-card-columns>
      <kd-resource-card-column>
        <div ng-if="::condition.type">{{condition.type}}</div>
        <div ng-if="::!condition.type">[[-|Label when there is no data.]]</div>
      </kd-resource-card-column>
      <kd-resource-card-column>
        <div ng-if="::condition.status">{{condition.status}}</div>
        <div ng-if="::!condition.status">[[-|Label when there is no data.]]</div>
      </kd-resource-card-column>
      <kd-resource-card-column>
        <div ng-if="::condition.lastProbeTime">{{condition.lastProbeTime | relativeTime}}</div>
        <md-tooltip ng-if="::condition.lastProbeTime"
                    md-delay="500"
                    md-autohide>
          [[Probed at | Tooltip heartbeat column of pod conditions ]] {{condition.lastProbeTime | date}}
        </md-tooltip>
        <div ng-if="::!condition.lastProbeTime">[[-|Label when there is no data.]]</div>
      </kd-resource-card-column>
      <kd-resource-card-column>
        <div ng-if="::condition.lastTransitionTime">
          {{condition.lastTransitionTime | relativeTime}}
        </div>
        <md-tooltip ng-if="::condition.lastTransitionTime"
                    md-delay="500"
                    md-autohide>
          [[Probed at | Tooltip transition column of pod conditions ]] {{condition.lastTransitionTime | date}}
        </md-tooltip>
        <div ng-if="::!condition.lastTransitionTime">[[-|Label when there is no data.]]</div>
      </kd-resource-card-column>
      <kd-resource-card-column>
        <div ng-if="::condition.reason">{{condition.reason}}</div>
        <div ng-if="::!condition.reason">[[-|Label when there is no data.]]</div>
      </kd-resource-card-column>
      <kd-resource-card-column>
        <div ng-if="::condition.message">{{condition.message}}</div>
        <div ng-if="::!condition.message">[[-|Label when there is no data.]]</div>
      </kd-resource-card-column>
    </kd-resource-card-columns>
  </kd-resource-card>
</kd-resource-card-list>
